import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * @ Author     ：侯耀祖
 * @ Description：
 */
public class zhongweishu {
    public double findMedianSortedArrays(int[] nums1, int[] nums2) {
        List<Integer> list1 = new ArrayList<Integer>();
        for (int i = 0; i < nums1.length; i++) {
            list1.add(nums1[i]);
        }
        for (int i = 0; i < nums2.length; i++) {
            list1.add(nums2[i]);
        }
        Collections.sort(list1);
        if (list1.size() % 2 == 0) {
            return (double) (list1.get((list1.size() / 2) - 1) + list1.get(list1.size() / 2 )) / 2;
        }else {
            return list1.get(list1.size() / 2);
        }
    }
}
